package nsu.grandfinal;

import android.app.Activity;
import android.os.Bundle;
import android.view.GestureDetector.OnGestureListener;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.widget.Button;
import android.widget.ViewFlipper;

public class QNA extends Activity implements OnGestureListener {
	ViewFlipper								flipper;
	Button										buttonNext;
	private static final int	min				= 200;
	private static final int	minus			= -200;
	private static final int	max				= 600;
	private static final int	minusmax	= -600;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.qna1);
		flipper = (ViewFlipper) findViewById(R.id.viewFlipper_details);
		GestureDetector gd = new GestureDetector(this);
	}
	
	public boolean onDown(MotionEvent e) {
		return false;
	}
	
	public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
		if (e1.getX() - e2.getX() >= min && e1.getX() - e1.getX() <= max) {
			flipper.showNext();
		}
		if (e1.getX() - e2.getX() <= minus && e1.getX() - e2.getX() <= minusmax) {
			flipper.showPrevious();
		}
		return false;
	}
	
	public void onLongPress(MotionEvent e) {}
	
	public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
		return true;
	}
	
	public void onShowPress(MotionEvent e) {}
	
	public boolean onSingleTapUp(MotionEvent e) {
		return false;
	}
}
